<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
    <title>天量科技管理后台</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta name="viewport" content="width=device-width">
    <link href="favicon.ico" rel="shortcut icon" type="image/x-icon">
    <link rel="stylesheet" href="css/templatemo_main.css">
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body ng-app="app" ng-controller="index">
<div class="navbar navbar-inverse" role="navigation">
    <div class="navbar-header">
        <div class="logo"><h1>天量科技管理后台</h1></div>
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
    </div>
</div>
<div class="template-page-wrapper">
    <div class="navbar-collapse collapse templatemo-sidebar">
        <ul class="templatemo-sidebar-menu">
            <li>
                <form class="navbar-form">
                    欢迎您:{{user.name || '访客'}}</span>
                </form>
            </li>
            <li ng-repeat="menu in menus" ng-class="menu.menuclass" ng-click="menuclick(menu)">
                <a ng-href="{{menu.url}}" ng-if="menu.items.length==0"><i ng-class="menu.icon"></i>{{menu.label}}</a>
                <a href="#" ng-if="menu.items.length>0">
                    <i ng-class="menu.icon"></i> {{menu.label}} <div class="pull-right"><span class="caret"></span></div>
                </a>
                <ul class="templatemo-submenu" ng-if="menu.items.length>0">
                    <li ng-repeat="item in menu.items"><a ng-href="{{item.url}}">{{item.label}}</a></li>
                </ul>
            </li>
            <li>
                <a href="#" data-toggle="modal" data-target="#confirmModal"><i class="fa fa-sign-out"></i>退出登录</a>
            </li>
        </ul>
    </div><!--/.navbar-collapse -->

    <div class="templatemo-content-wrapper">
        <div class="templatemo-content">
            <ol class="breadcrumb">
                <li><a href="index.html">首页</a></li>
            </ol>
            <div class="row" ng-if="haserror">
                <div class="alert alert-danger alert-dismissible" role="alert">
                    <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <strong>发生异常情况:{{errormessage}}</strong>
                </div>
            </div>

            <div class="row" ng-if="!haserror">
            </div>
            <div class="templatemo-charts">

                <div class="row">
                    <div class="col-md-6 col-sm-6">
                        <div class="panel panel-success">
                            <div class="panel-heading">基金净值</div>
                            <canvas id="templatemo-line-chart"></canvas>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Modal -->
    <div class="modal fade" id="confirmModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <h4 class="modal-title" id="myModalLabel">确定退出吗</h4>
                </div>
                <div class="modal-footer">
                    <a ng-click="logout()" class="btn btn-primary" data-dismiss="modal">确定</a>
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                </div>
            </div>
        </div>
    </div>

    <footer class="templatemo-footer">
        <div class="templatemo-copyright">
            <p>Copyright &copy; 2018 By <a href="http://skyquant.cn" title="天量科技" target="_blank">天量科技</a></p>
        </div>
    </footer>
</div>
</body>

<script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
<script src="//cdn.bootcss.com/angular.js/1.5.8/angular.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="js/common.js"></script>
<script src="js/Chart.min.js"></script>
<script src="js/templatemo_script.js"></script>
<script type="text/javascript">
  'use strict';
  var app = angular.module('app', []);
  app.controller('index', ['$scope', '$http', function ($scope, $http) {
      //每个页面都要有的方法
      $scope.init = function(){
        getUser($http,$scope,'外汇','市场信息');
      }

      $scope.logout = function(){
        logout($http);
      }

      $scope.menuclick=function(menu){
        changemenuclass($scope,menu);
      }

      //每个页面都需要重写此方法，发生在init之后
      $scope.initAfter = function(){
      }

      $scope.sendCode = function(){
        var phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/;
        if (!phoneReg.test($scope.reg_tel)) {
            alert('请输入有效的手机号码！');
            return false;
        }else{
            var pData = {tel:$scope.reg_tel};
            $http({method:'POST',url:'quant4j-service/authority/send_reg_sms',params:pData}).success(function(data,header,config,status) {
              if(data.ok){
                alert('短信输入成功，请输入验证码，同时补全其他信息');
                $scope.btn_code_show = false;
              }else{
                alert(data.message);
              }
            }).error(function(data,header,config,status){
                console.log(data);
            });
        }
      }

      $scope.init();
      $scope.btn_code_show=true;//验证码按钮
  }]);

  var labels = ['08-06','08-08','08-10','08-13','08-15','08-17','08-20','08-22','08-24','08-27','08-39',
                '09-03','09-05','09-07','09-10','09-12','09-14','09-17','09-19','09-21','09-24','09-26','09-28',
                '10-01','10-03','10-05','10-08','10-10','10-12','10-15','10-17','10-19','10-22','10-24','10-26','10-29','10-31',
                '11-02'
                ];
  var datas = [1,0.9991,0.9982,0.9858,0.9728,0.96472,0.9743,0.9643,0.9518,0.9822,1.0378,
               1.061,1.0521,1.0482,1.0528,1.0328,1.0272,1.0143,1.0643,1.0818,1.0722,1.0778,1.0845,
               1.10,1.0951,1.0821,1.1048,1.0898,1.0947,1.11243,1.1243,1.1058,1.1232,1.1478,1.165,1.1876,1.1921,
                1.181]

  var randomScalingFactor = function(){ return Math.round(Math.random()*100)};
  var lineChartData = {
    labels : labels,
    datasets : [
    {
      label: "My First dataset",
      fillColor : "rgba(220,220,220,0.2)",
      strokeColor : "rgba(220,220,220,1)",
      pointColor : "rgba(220,220,220,1)",
      pointStrokeColor : "#fff",
      pointHighlightFill : "#fff",
      pointHighlightStroke : "rgba(220,220,220,1)",
      data : datas
    }
    ]

  } // lineChartData
  window.onload = function(){
    var ctx_line = document.getElementById("templatemo-line-chart").getContext("2d");

    window.myLine = new Chart(ctx_line).Line(lineChartData, {
      responsive: true
    });
  }
</script>
</html>